﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="post-new.aspx.cs" Inherits="EnmineKaitlin.admin.post_new" MasterPageFile="~/MasterPage/AdminDefault.Master" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %>
<asp:Content ID="ctnpostnew" runat="server" ContentPlaceHolderID="cphContent">
    <div class="form list">        
        <h2><span class="icon"><img src="../images/admin/Play.png"></span><asp:Label ID="lblFunction" runat="server"></asp:Label></h2>
        <div class="content">
            <asp:Label ID="lblNotice" runat="server" CssClass="error"></asp:Label>
            <asp:Panel ID="pnlAddPost" runat="server">            
                <div class="form-left left">                    
                    <p class="label">Tiêu đề:</p>
                    <p class="input"><asp:TextBox ID="txtTitle" runat="server" Width="695" CssClass="txt required"></asp:TextBox></p> 
                    <asp:Panel ID="pnlExcerpt" runat="server">
                    <p class="label">Tóm tắt:</p>
                    <p class="input"><CKEditor:CKEditorControl ID="txtExcerpt" FilebrowserBrowseUrl="/ckfinder/ckfinder.html" Height="100"
		                            FilebrowserImageBrowseUrl="/ckfinder/ckfinder.html?Type=Images" FilebrowserFlashBrowseUrl="/ckfinder/ckfinder.html?Type=Flash"
		                            FilebrowserUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Files"
		                            FilebrowserImageUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Images"
		                            FilebrowserFlashUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Flash" runat="server"></CKEditor:CKEditorControl></p> 
                    </asp:Panel>
                    <p class="label">Nội dụng:</p>                        
                    <p class="input"><CKEditor:CKEditorControl ID="ckeContent" FilebrowserBrowseUrl="/ckfinder/ckfinder.html" Height="300"
		                            FilebrowserImageBrowseUrl="/ckfinder/ckfinder.html?Type=Images" FilebrowserFlashBrowseUrl="/ckfinder/ckfinder.html?Type=Flash"
		                            FilebrowserUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Files"
		                            FilebrowserImageUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Images"
		                            FilebrowserFlashUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Flash" runat="server"></CKEditor:CKEditorControl></p>                    
                </div>
                <div class="form-right right">
                    <div class="form-right-box">
                        <h2>Cập nhật</h2>
                        <div class="box-content">
                            <table border="0">
                                <tr><td>Ngôn ngữ:</td><td><asp:DropDownList ID="ddlLanguage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguage_SelectedIndexChange">
                                    <asp:ListItem Text="Tiếng Việt" Value="vn"></asp:ListItem>
                                    <asp:ListItem Text="English" Value="en"></asp:ListItem>
                                </asp:DropDownList></td></tr>                                                             
                                <tr><td>Ngày cập nhật:</td><td><asp:TextBox ID="txtCreateDate" runat="server" Width="135" CssClass="txt datepicker required"></asp:TextBox></td></tr>                            
                                <tr><td></td><td><asp:Button ID="btnAdd" Text="Đăng bài viết" runat="server" CssClass="btn" CommandName="Add" CommandArgument='<%#BindCommandArgument() %>' OnCommand="btnAdd_Click" />
                                <asp:Button ID="btnSave" Text="Lưu" runat="server" CssClass="btn" CommandName="Save" CommandArgument="draft" OnCommand="btnAdd_Click" />
                                </td></tr>
                            </table>
                        </div>
                    </div>
                    <asp:Panel ID="pnlCategory" runat="server">
                    <div class="form-right-box">
                        <h2>Chuyên mục</h2>
                        <div class="box-content">                    
                            <asp:CheckBoxList ID="cblCategory" runat="server"></asp:CheckBoxList>
                        </div>
                    </div>
                    </asp:Panel>
                    <asp:Panel ID="pnlFeaturedImage" runat="server">
                    <div class="form-right-box">
                        <h2>Ảnh đại diện</h2>
                        <div class="box-content">  
                            <asp:HiddenField ID="hdfFeaturedImage" runat="server" />
                            <asp:Image ID="imgFeaturedImage" runat="server" Width="238" Height="200" />
		                    <input type="button" value="Chọn ảnh đại diện" class="btn" onclick="BrowseServer();" />
                        </div>
                    </div>
                    </asp:Panel>
                </div>
            </asp:Panel>
            <asp:Panel ID="pnlEditPost" runat="server" Visible="false">
                <asp:Repeater ID="rptDetailPage" runat="server" OnItemCommand="rptDetailPost_ItemCommand">
                    <ItemTemplate>
                        <div class="form-left left">
                            <p class="label">Tiêu đề:</p>
                            <p class="input"><asp:TextBox ID="txtTitle" Text='<%#Eval("Title") %>' runat="server" Width="695" CssClass="txt required"></asp:TextBox></p>                             
                            <p class="label">Nội dụng:</p>                        
                            <p class="input"><CKEditor:CKEditorControl ID="ckeContent" FilebrowserBrowseUrl="/ckfinder/ckfinder.html" Height="300"
		                                    FilebrowserImageBrowseUrl="/ckfinder/ckfinder.html?Type=Images" FilebrowserFlashBrowseUrl="/ckfinder/ckfinder.html?Type=Flash"
		                                    FilebrowserUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Files"
		                                    FilebrowserImageUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Images"
		                                    FilebrowserFlashUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Flash" runat="server" Text='<%#Eval("Content") %>'></CKEditor:CKEditorControl></p>                    
                        </div>
                        <div class="form-right right">
                            <div class="form-right-box">
                                <h2>Cập nhật</h2>
                                <div class="box-content">
                                    <table border="0">
                                        <tr><td>Ngôn ngữ:</td><td><asp:DropDownList ID="ddlLanguageDetail" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguageDetail_SelectedIndexChange" SelectedValue='<%#Eval("LangID") %>'>
                                            <asp:ListItem Text="Tiếng Việt" Value="vn"></asp:ListItem>
                                            <asp:ListItem Text="English" Value="en"></asp:ListItem>
                                        </asp:DropDownList></td></tr>
                                        <tr><td>Ngày cập nhật:</td><td><asp:TextBox ID="txtCreateDate" runat="server" Text='<%#DisplayDateTime(Convert.ToString(Eval("CreateDate"))) %>' Width="135" CssClass="txt datepicker required"></asp:TextBox></td></tr>
                                        <tr><td></td><td><asp:Button ID="btnUpdate" Text="Cập nhật" runat="server" CssClass="btn" CommandName="Update" CommandArgument='<%#BindCommandArgument() %>' /></td></tr>
                                    </table> 
                                </div>
                            </div>                                                    
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
                <asp:Repeater ID="rptDetailPost" runat="server" OnItemCommand="rptDetailPost_ItemCommand">
                    <ItemTemplate>
                        <div class="form-left left">
                            <p class="label">Tiêu đề:</p>
                            <p class="input"><asp:TextBox ID="txtTitle" Text='<%#Eval("Title") %>' runat="server" Width="695" CssClass="txt required"></asp:TextBox></p> 
                            <p class="label">Tóm tắt:</p>
                            <p class="input"><CKEditor:CKEditorControl ID="txtExcerpt" FilebrowserBrowseUrl="/ckfinder/ckfinder.html" Height="100" Text='<%#Eval("Excerpt") %>'
		                            FilebrowserImageBrowseUrl="/ckfinder/ckfinder.html?Type=Images" FilebrowserFlashBrowseUrl="/ckfinder/ckfinder.html?Type=Flash"
		                            FilebrowserUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Files"
		                            FilebrowserImageUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Images"
		                            FilebrowserFlashUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Flash" runat="server"></CKEditor:CKEditorControl></p> 
                            <p class="label">Nội dụng:</p>                        
                            <p class="input"><CKEditor:CKEditorControl ID="ckeContent" FilebrowserBrowseUrl="/ckfinder/ckfinder.html" Height="300"
		                                    FilebrowserImageBrowseUrl="/ckfinder/ckfinder.html?Type=Images" FilebrowserFlashBrowseUrl="/ckfinder/ckfinder.html?Type=Flash"
		                                    FilebrowserUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Files"
		                                    FilebrowserImageUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Images"
		                                    FilebrowserFlashUploadUrl="/ckfinder/core/connector/aspx/connector.php?command=QuickUpload&type=Flash" runat="server" Text='<%#Eval("Content") %>'></CKEditor:CKEditorControl></p>                    
                        </div>
                        <div class="form-right right">
                            <div class="form-right-box">
                                <h2>Cập nhật</h2>
                                <div class="box-content"> 
                                    <table border="0">
                                        <tr><td>Ngôn ngữ:</td><td><asp:DropDownList ID="ddlLanguageDetail" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguageDetail_SelectedIndexChange" SelectedValue='<%#Eval("LangID") %>'>
                                            <asp:ListItem Text="Tiếng Việt" Value="vn"></asp:ListItem>
                                            <asp:ListItem Text="English" Value="en"></asp:ListItem>
                                        </asp:DropDownList></td></tr>
                                        <tr><td>Ngày cập nhật:</td><td><asp:TextBox ID="txtCreateDate" runat="server" Text='<%#DisplayDateTime(Convert.ToString(Eval("CreateDate"))) %>' Width="135" CssClass="txt datepicker required"></asp:TextBox></td></tr>
                                        <tr><td></td><td><asp:Button ID="btnUpdate" Text="Cập nhật" runat="server" CssClass="btn" CommandName="Update" CommandArgument='<%#BindCommandArgument() %>' /></td></tr>
                                    </table>                                    
                                </div>
                            </div>
                            <div class="form-right-box">
                                <h2>Chuyên mục</h2>
                                <div class="box-content">                    
                                    <asp:CheckBoxList ID="cblCategory" runat="server"></asp:CheckBoxList>
                                </div>
                            </div>                        
                            <div class="form-right-box">
                                <h2>Ảnh đại diện</h2>
                                <div class="box-content"> 
                                    <asp:HiddenField ID="hdfFeaturedImage" runat="server" Value='<%#Eval("FeaturedImage") %>' />                                                                                  
                                    <asp:Image ID="imgFeaturedImage" runat="server" Width="238" Height="200" ImageUrl='<%#Eval("FeaturedImage") %>' />
		                            <input type="button" value="Chọn ảnh đại diện" class="btn" onclick="BrowseServer();" />
                                </div>
                            </div>
                            <div class="form-right-box">
                                <h2>Gửi email</h2>
                                <div class="box-content">
                                    <table>
                                        <tr><td><asp:CheckBox ID="cbxSend" runat="server" /></td><td><asp:Button ID="btnSendEmail" runat="server" Text="Gửi tới các email đăng ký" CssClass="btn" CommandName="SendMail" /></td></tr>
                                    </table>                                     		                            
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
